﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="J_Product.ascx.cs" Inherits="Pub_Module_J_Product" %>

<script language="javascript" type="text/javascript" src="<%= ResolveClientUrl("~/")%>Pub/Js/JQ/jquery.tooltip.v.1.1.js"></script>

<style>
#simpleTooltip { 
  border:1px solid red;
	    background:#f7f5d1;
	    padding:2px 5px;
	    color:#333;
	    display:none;

}
  
</style>

<script language="javascript" type="text/javascript">
var Url='<%= ResolveClientUrl("~/")%>'; 
       
        $(document).ready(function() {  
                           $('.cssAddBasket').live('click', function()
                           {     
                                   $obj=$(this);   
                                   divCoverCart=$obj;
                                   while(divCoverCart.attr("refID")!="CoverCartID")
                                   {
                                        divCoverCart=divCoverCart.parent();
                                   }                                              
                                    divCoverCart=divCoverCart.parent();                                                                    
                                   var elemID=LoadingAjaxCart($("#hidElemShopping"),$("#<%= divLoading.ClientID%>"),divCoverCart);
                                   fnAddBasket(elemID,$obj) ;                                 
                            }); 
                            
                           $('.cssCancelBasket').live('click', function()
                           { 
                                $obj=$(this);  
                                  divCoverCart=$obj;
                                   while(divCoverCart.attr("refID")!="CoverCartID")
                                   {
                                        divCoverCart=divCoverCart.parent();
                                   }         
                                    divCoverCart=divCoverCart.parent();                                                                                                             
                                var elemID=LoadingAjaxCart($("#hidElemShopping"),$("#<%= divLoading.ClientID%>"),divCoverCart); 
                                fnCancelBasket(elemID,$obj);
                                
                           });
                          
                         
                           
                          
                          
                         
                         /*************************** ToolTip ****************************/
//                         xOffset = 10;
//		                 yOffset = 20;	
		                 
		                 var showPopupPD;
                         $("li.liHoverProPD").hover(function(e)
                         {	
                            try{
                            showPopupPD.abort();
                            }catch(e){}
                           
                            PDID=$(this).attr("PDID");
                            CatID=$(this).attr("CatID");
                            var objtool=$(this);
			                var tipX = e.pageX + 12;
                            var tipY = e.pageY + 12;                          
                            $("body").append("<div id='simpleTooltip' style='position: absolute; z-index: 100;'><font style='font-size:11px'>Loading...</font></div>");
                           			
                           showPopupPD= $.ajax({ 
                                       type: "GET", 
                                       url: Url+"Pub/Ajax/AjaxQuery.aspx?type=TooltipPropertiesPD&CatID="+CatID+"&PDID="+PDID, 
                                       success: function(resp)
                                       {
                                                if(resp!="")                                                  
                                                {                                
                                                     $("#simpleTooltip").html(resp);
                                                      if($.browser.msie) var tipWidth = $("#simpleTooltip").outerWidth(true)
                                                        else var tipWidth = $("#simpleTooltip").width()
                                                        $("#simpleTooltip").width(tipWidth);
                                                       // $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");        

			                                    }
			                                    else
			                                    {
			                                         $("#simpleTooltip").remove();			
			                                    }
			                                                    
                                       } 
                                });    
		                       	
                        },
	                    function(){		                      
		                        $("#simpleTooltip").remove();				               
                            });	
                        $('#simpleTooltip').live('mouseout', function()
                        {
                      
		                       $("#simpleTooltip").remove();
	                    });	 
	                       $("li.liHoverProPD").mousemove(function(e)
	                       {
		                        var tipX = e.pageX + 12;
				                var tipY = e.pageY + 12;
				                var tipWidth = $("#simpleTooltip").outerWidth(true);
				                var tipHeight = $("#simpleTooltip").outerHeight(true);
				                if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
				                if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
				                $("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");

	                    });		
	                    
         });    
</script>

<asp:Panel ID="TooltipPD" runat="server" CssClass="tooltipHover" Style="text-align: left;
    padding: 10px; display: none" Visible="false">
</asp:Panel>
<asp:Panel ID="divLoading" CssClass="div-loadingAbs" runat="server">
</asp:Panel>
<div style="background-color: #fffbff; padding: 5px; text-align: center; margin: 0px auto"
    class="div_skin-tango1">
    <div class="coverlblTitleProduct">
        <asp:Label CssClass="lbl_Normal1"  ForeColor="white" ID="lblEmpty" runat="server" Text="Hiện tại sản phẩm chưa được cập nhật. Vui lòng quay lại sau..."
            Visible="false"></asp:Label>
        <asp:Label ID="lblTitleProduct" runat="server" Text="" CssClass="lblTitleProduct"></asp:Label></div>
    <asp:DataList ID="dtlThumbnail" runat="server" RepeatDirection="Horizontal" CssClass="GridCoverCart"
        DataKeyField="PdID" CellPadding="0" CellSpacing="0" OnItemDataBound="dtlThumbnail_ItemDataBound"
        RepeatColumns="4" OnItemCommand="dtlThumbnail_ItemCommand1">
        <ItemStyle Wrap="False" />
        <ItemTemplate>
            <asp:Panel ID="divCoverCart" runat="server" CssClass="CoverCart" refID="CoverCartID"
                Style="width: 178px; height: 310px;">
                <ul class="fixUlBlock" style="width: 100%">
                    <li class="liHoverProPD" pdid='<%# Eval("PDID") %>' catid='<%# Eval("CatID") %>'>
                        <div class="divBlock" style="text-align: center">
                            <ul class="fixUlBlock">
                                <li>
                                    <asp:Literal ID="ltlImages" runat="server"></asp:Literal></li>
                                <li>
                                    <asp:Label ID="lblTenSP" runat="server" CssClass="lbl_TitleProduct" Text='<%# Eval("PDName") %>'
                                        Width="160px"></asp:Label></li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <asp:Panel ID="pnlKindNo" runat="server" Width="100%" CssClass="divBlock" Style="text-align: left">
                            <ul class="fixUlBlock">
                                <li>
                                    <asp:Label ID="Label3" runat="server" CssClass="lbl_TitlePrice" Text="Bảo hành: "></asp:Label>
                                    <asp:Label ID="Label4" runat="server" CssClass="lbl_Properties" Text='<%# Eval("Warranty")  %>'></asp:Label>
                                    <asp:Label ID="Label3434" runat="server" CssClass="lbl_TitlePrice" Text="Tháng"></asp:Label></li>
                                <li>
                                    <asp:Panel ID="pnlPrice" runat="server">
                                        <asp:Label ID="Label1" runat="server" CssClass="lbl_TitlePrice" Text="Giá: "></asp:Label>
                                        <asp:Label ID="lblDongia" runat="server" CssClass="lbl_Price" Text='<%# Eval("Price")  %>'></asp:Label>
                                        <asp:Label ID="Label6" runat="server" CssClass="lbl_Rate" Text='<%# Eval("Rate")  %>'
                                            ForeColor="Navy"></asp:Label>
                                    </asp:Panel>
                                </li>
                                <li>
                                    <asp:Panel ID="pnlSaleOf" runat="server" Visible="false">
                                        <asp:Label ID="Label222" runat="server" CssClass="lbl_TitlePrice" Text="Chỉ còn: "></asp:Label>
                                        <asp:Label ID="lblDiscountPrice" runat="server" CssClass="lbl_Price" Text='<%# Eval("DiscountPrice")  %>'></asp:Label>
                                        <asp:Label ID="Label923" runat="server" CssClass="lbl_Rate" Text='<%# Eval("DiscountRate")  %>'
                                            ForeColor="Navy" Font-Size="13px"></asp:Label>
                                    </asp:Panel>
                                </li>
                            </ul>
                        </asp:Panel>
                        <asp:Panel ID="pnlFilm" runat="server" Width="100%" CssClass="divBlock" Style="text-align: left"
                            Visible="false">
                            <ul class="fixUlBlock">
                                <li>
                                    <asp:Label ID="Label2" runat="server" CssClass="lbl_TitlePrice" Text="Dung lượng: "></asp:Label>
                                    <asp:Label ID="Label5" runat="server" CssClass="lbl_Properties" Text='<%# Eval("Capacity")  %>'></asp:Label>
                                </li>
                            </ul>
                        </asp:Panel>
                    </li>
                    <li>
                        <table border="0" cellpadding="0" cellspacing="0" class="divBlock" style="text-align: right;
                            float: right">
                            <tr>
                                <td>
                                    <asp:Image ID="imgHot" runat="server" Visible="false" /></td>
                                <td>
                                    <asp:Literal ID="ltrDetail" runat="server"></asp:Literal>
                                </td>
                                <td>
                                    <img id="btnISelect" runat="server" class='cssAddBasket' discountprice='<%# Eval("DiscountPrice")  %>'
                                        discountrate='<%# Eval("DiscountRate")  %>' capacity='<%# Eval("Capacity")  %>'
                                        issaleof='<%# Eval("IsSaleOf")  %>' kindno='P' pdid='<%# Eval("PDID")  %>'
                                        pdname='<%# Eval("PDName")  %>' price='<%# Eval("Price")  %>' rate='<%# Eval("Rate")  %>'
                                        src="../../Images/Icon/buy.gif" style="cursor: pointer" /></td>
                                <td>
                                    <img src="../../Images/Icon/cancel.GIF" class="cssCancelBasket" style="cursor: pointer;
                                        display: none" id="btnICancel" runat="server" pdid='<%# Eval("PDID")  %>'  kindno='P'/></td>
                            </tr>
                        </table>
                    </li>
                </ul>
            </asp:Panel>
        </ItemTemplate>
    </asp:DataList>
    <asp:Panel ID="pnControl" runat="server" HorizontalAlign="Center" Width="100%">
        <div width="100%" align="center">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" align="center">
                        <asp:Label ID="Label7" runat="server" Text="Hiển thị "></asp:Label>
                        <asp:TextBox ID="txtPageSize" runat="server" CssClass="txt_Common" Height="13px"
                            Width="25px" MaxLength="3"></asp:TextBox>
                        <asp:Label ID="Label8" runat="server" Text="mẩu tin trên <b>1</b> trang"></asp:Label>&nbsp;<asp:Button
                            ID="btnGo" runat="server" CssClass="btn_Common" Height="21px" OnClick="Button1_Click"
                            Text="Go" Width="33px" /></td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblDisplay" runat="server"></asp:Label>
                        <asp:Label ID="lblrecordcount" runat="server" Visible="False"></asp:Label>
                        <asp:Label ID="lblindex" runat="server" Visible="False">0</asp:Label>
                        <asp:Label ID="lblpageSize" runat="server" Visible="False">10</asp:Label></td>
                    <td>
                        <asp:ImageButton ID="btnIFirst" runat="server" ImageUrl="~/Images/Icon/FirstPage.png"
                            OnClick="btnIFirst_Click" /><asp:ImageButton ID="btnIPre" runat="server" ImageUrl="~/Images/Icon/PrevPage.png"
                                OnClick="btnIPre_Click" /><asp:ImageButton ID="btnINext" runat="server" ImageUrl="~/Images/Icon/NextPage.png"
                                    OnClick="btnINext_Click" /><asp:ImageButton ID="btnILast" runat="server" ImageUrl="~/Images/Icon/LastPage.png"
                                        OnClick="btnILast_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</div>
